import { request } from '@/utils/request'
import type { LoginUser, Type, vadatileCode } from '@/types/user'
// 通过密码登录
export const loginPassword = (mobile: string, password: string) => {
  return request<LoginUser>('/login/password', 'post', {
    mobile,
    password
  })
}

// 获取验证码
export const getCodeAPI = (mobile: string, type: Type) => {
  return request<vadatileCode>('/code', 'GET', {
    mobile,
    type
  })
}
// 验证码登录
export const loginCode = (mobile: string, code: string) => {
  return request<LoginUser>('/login', 'POST', {
    mobile,
    code
  })
}
